class OwnException extends Exception{


public OwnException() {}

public OwnException(String msg)
    {
    super(msg);
    }
}

class Test
     {
     public Test(){}
     
     void method1(int a ,int b) throws OwnException
      {
      System.out.println("You called method1 !!!\n\n");
      
      if(a==b)
        {
        String description="In method \"method1\" an OwnException has been generated\n "+ " The "+a+" and "+b+" arguments are equal!!!\n"+ " Call this method with no equal arguments.";
        throw new OwnException(description);
        }
      }
             
     
      void method2(int a, int b)throws OwnException
       {
       System.out.println("You called method2 !!!\n\n");
      
       if((a*b)>10) 
         {
         String description="In method \"method2\" a OwnException has been generated\n "+" The "+a+" * "+b+" is grater that 10 !!!\n"+" Call this method with smaller arguments.";
         throw new OwnException(description);
 }
       }       
     }

class TestException{
 public static void main(String[] args)
  {
  Test t=new Test();
  try{
     t.method1(22,20); //NO EXCEPTION 
     t.method2(11,23); //EXCEPTION   
     }catch(OwnException e)
       {e.printStackTrace();}
  }
}              
